package com.starleague.common;

import com.starleague.common.Stringifier;

public abstract class AbstractChildVisitable
        implements IChildVisitable
{
    protected AbstractChildVisitable()
    {
        // For serialization
    }

    @Override
    public void accept(IChildVisitor visitor)
    {
        visitor.visit("hash", Integer.valueOf(this.hashCode()));
    }

    public String toString(int depth)
    {
        return (new Stringifier(this, depth)).toString();
    }

    @Override
    public String toString()
    {
        return toString(Integer.MAX_VALUE);
    }
}
